home *** CD-ROM | disk | FTP | other *** search
/ L' Effet Pommier 3 / L'Effet Pommier - Volume 03.iso / Graphismes / Bitmap / NIH Image 1.59 / Macros / Markup Macros < prev    next >
Text File  |  1995-01-26  |  1KB  |  40 lines

  1. {
  2. These two macros enable the user to outline and label objects on an
  3. image using any of the six reserved colors and to then save the resulting
  4. text and graphics as a separate file. Note that you can change any of the
  5. first five predefined colors (red, green, blue, yellow, cyan) by 
  6. double-clicking at the bottom of the LUT window with the
  7. eye dropper tool.
  8. }
  9.  
  10. macro 'Setup Image for Markup [S]';
  11. {
  12. Sets pixels with values in the range 0-7 to zero so we can
  13. draw graphics and text on the image using the 6 reserved colors
  14. (pixel values 1-6).
  15. }
  16. begin
  17.   if not((RedLut[6]=255) and (GreenLut[6]=0) and (BlueLut[6]=255)) then begin
  18.      PutMessage('Use "LUT Options" to reserve 6 colors.');
  19.      exit;
  20.   end;
  21.   SelectAll;
  22.   ChangeValues(0,7,0);
  23.   KIllRoi;
  24. end;
  25.  
  26.  
  27. macro 'Extract Graphics [E]';
  28. {
  29. Creates a copy of the current image with pixels in the range 8-255
  30. set to zero. The resulting image has only the text and graphics drawn
  31. using the 6 reserved colors (pixel values 1-6).
  32. begin
  33.   if not((RedLut[6]=255) and (GreenLut[6]=0) and (BlueLut[6]=255)) then begin
  34.      PutMessage('Use "LUT Options" to reserve 6 colors.');
  35.      exit;
  36.   end;
  37.   Duplicate(concat(WindowTitle,'-M'));
  38.   ChangeValues(8,255,0);
  39. end;